﻿using Modules.Project;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules
{
    /// <summary>
    /// 保证金退还记录表
    ///</summary>
    [TableName("project_guarantee_refund")]
    [Description("保证金退还记录")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "Status")]
    [Serializable]
    public class ProjectGuaranteeRefund : IEntity
    {
        /// <summary>
        ///
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 需要退还保证金的缴纳信息Id
        ///</summary>
        [Column("guarantee_payment_id")]
        public int? GuaranteePaymentId { get; set; }

        /// <summary>
        /// 缴纳主体名称
        /// </summary>
        [Column("payment_name")]
        public string? PaymentName { get; set; }

        /// <summary>
        /// 缴纳主体社会统一信用代码
        /// </summary>
        [Column("payment_code")]
        public string? PaymentCode { get; set; }

        /// <summary>
        /// 状态(0：待审核 1：已退还 )
        ///</summary>
        [Column("status")]
        public 保证金退还状态 Status { get; set; }

        /// <summary>
        /// 申请退还金额
        ///</summary>
        [Column("apply_amount")]
        public decimal? ApplyAmount { get; set; }

        /// <summary>
        /// 申请理由
        ///</summary>
        [Column("apply_reason")]
        public string ApplyReason { get; set; }

        /// <summary>
        /// 退还决定单位
        ///</summary>
        [Column("refund_organization")]
        public string RefundOrganization { get; set; }

        /// <summary>
        /// 退还决定单位统一社会信用代码
        ///</summary>
        [Column("refund_organization_code")]
        public string RefundOrganizationCode { get; set; }

        /// <summary>
        /// 动用通知文书号
        ///</summary>
        [Column("notification_letter")]
        public string NotificationLetter { get; set; }

        /// <summary>
        /// 退还日期
        ///</summary>
        [Column("refund_time")]
        public DateTime? RefundTime { get; set; }

        /// <summary>
        /// 退还金额
        ///</summary>
        [Column("refund_amount")]
        public decimal? RefundAmount { get; set; }

        /// <summary>
        /// 退还说明
        ///</summary>
        [Column("refund_reason")]
        public string RefundReason { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime? CreateTime { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}